package ch.bfh.medinfo.speakingsms.receiver.sms;

import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.IBinder;
import android.preference.PreferenceManager;

public class RememberService extends Service {
	public static final String REMEMBER_PHONE_NO="remember_phone_no";
	public static String REMEMBER_PHONE_NO_ACTION = "ch.bfh.medinfo.speakingsms.receiver.sms.REMEMBER_PHONE_NO";
	private SharedPreferences sharedPreferences;
	
	@Override
	public void onCreate() {
		super.onCreate();
		sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this
				.getApplicationContext());
		
	}

	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		if (intent == null) {
			return super.onStartCommand(intent, flags, startId);
		}
		
		return super.onStartCommand(intent, flags, startId);

	}
	
	private void rememberPhoneNumber(String phoneNumber){
		Editor editor = sharedPreferences.edit();
		editor.putString(REMEMBER_PHONE_NO, phoneNumber);
		editor.apply();
	}
	
	private String getPhoneNumber(){
		return sharedPreferences.getString(REMEMBER_PHONE_NO, null);
	}

	@Override
	public IBinder onBind(Intent intent) {
		// TODO Auto-generated method stub
		return null;
	}

}
